<?php
require_once BaseUtil::getModulePath("base") . '/models/BaseDao.php';
class UserDao extends BaseDao
{
    protected $_name = 'admins';
    public function getUserById ($user_id)
    {
		$select=$this->db_r->select();
		$select->from($this->_name);
		$select->where('id = ?', $user_id);
        $sql = $select->__toString();
        return $this->db_r->fetchRow($sql);
		
    }
    public function updateUser ($set,$user_id)
    {
        $db = $this->db_w;
        $where = $db->quoteInto('id = ?', $user_id);
        return $db->update($this->_name, $set, $where);
    }
   public function deleteUser ($user_id)
    {
        $db = $this->db_w;
        $set = array('is_delete' => 1);
        $where = $db->quoteInto('id = ? ', $user_id);
        $db->update($this->_name, $set, $where);
    }
}
